package com.zsrt.java.day20161223.cg.homework.cal;
//��switch�﷨��ɣ� �Ӽ��˳���ģ�ļ�����  ͬʱ��if else Ҳдһ��

import java.util.Scanner;

import org.junit.Test;

public class TestSwitchCal {
	@Test
	public void calTest(){
		Scanner sc = new Scanner(System.in);
		System.out.println("�������һ������ a");
		int a = sc.nextInt();		
		System.out.println("������һ������� +-*/%");
		String z = sc.next();
		System.out.println("������ڶ������� a");		
		int b = sc.nextInt();
		sc.close();
		
		switch(z){
		case "+" : System.out.println(" \t"+a+"\n"+"+"+"\t"+b);
				   System.out.println("----------");
				   System.out.println("\t"+(a+b));
				   break;
				   
		case "-" : System.out.println(" \t"+a+"\n"+"-"+"\t"+b);
		System.out.println("----------");		
		System.out.println("\t"+(a-b));
				   break;
		
		case "*" : System.out.println(" \t"+a+"\n"+"*"+"\t"+b);
		System.out.println("----------");
		System.out.println("\t"+(a*b));
				   break;
		
		case "/" : System.out.println(" \t"+a+"\n"+"/"+"\t"+b);
		System.out.println("----------");
		System.out.println("\t"+(a/b));
				   break;
				   
		case "%" : System.out.println(" \t"+a+"\n"+"%"+"\t"+b);
		System.out.println("----------");
		System.out.println("\t"+(a%b));
				   break;
		default:System.out.println("��������");
			
	
		}
	}

}
